<?php
$cfg['AllowArbitraryServer'] = true;

//这里把远程服务器的用户名，密码等，拼接为一个多维数组
$connect_hosts = array(
    '1'=>array(
        'verbose' => '本地MiniWenxue',
        'host'   => '172.17.0.1',  //本地服务器
        'port' => 3306,
        'user'   => 'root',
        'password' => '123456'
    ),
    '2'=>array(
        'verbose' => '本地MiniWenxue2',
        'host'   => '172.17.0.3',  //本地服务器
        'port' => 3306,
        'user'   => 'root',
        'password' => '123456'
    ),
);

for ($i=1; $i<=count($connect_hosts); $i++) {
    /* Server parameters */
    $cfg['Servers'][$i]['verbose'] = $connect_hosts[$i]['verbose'];   //链接名字
    $cfg['Servers'][$i]['host'] = $connect_hosts[$i]['host'];   //修改host
    $cfg['Servers'][$i]['port'] = $connect_hosts[$i]['port'];  //端口
    $cfg['Servers'][$i]['user'] = $connect_hosts[$i]['user'];  //修改用户名
    $cfg['Servers'][$i]['password'] = $connect_hosts[$i]['password']; //密码
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    /* Authentication type */
    // 使用cookie可以在登录页保存登录过的服务器列表信息
    // 使用config可以直接使用我们配置的服务器信息作为下拉框选项.
    // $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['auth_type'] = 'config';

}
?>